﻿var status = 0;




function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {

    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1)                           						
            status++;
        else
            status--;
        if (status == 0) {
            cm.sendSimple ("#e親愛的玩家#r#h #\r\n#e請問需要甚麼服務呢?\r\n"+
           "#L0#劍士商店"+
           "\r\n#L1#法師商店"+
           "\r\n#L2#弓手商店"+
           "\r\n#L3#盜賊商店"+
           "\r\n#L4#海盜商店"+
           "\r\n#L5#雜貨商店"+
           "\r\n#L6#飛鏢箭矢子彈商店");
        } else if (status == 1) {
            if (selection == 0) {
                cm.dispose();
                cm.openNpc(9390123, 10);
       } else if (selection == 1) {
                cm.dispose();
                cm.openNpc(9390123, 11);
       } else if (selection == 2) {
		cm.dispose();
                cm.openNpc(9390123, 12);
       } else if (selection == 3) {
		cm.dispose();
                cm.openNpc(9390123, 13);
       } else if (selection == 4) {
		cm.dispose();
                cm.openNpc(9390123, 14);
       } else if (selection == 5) {
		cm.dispose();
                cm.openShop(352);
       } else if (selection == 6){
        cm.dispose();
                cm.openShop(64);

		} else if ( selection == 16){
		cm.dispose();
		cm.warp(911005901, 0);
		return;
}
}
        }
    }
